﻿@namespace Masa.Blazor.Docs.Components
@inject I18n I18n

@if (Data is not null && Data.Any())
{
    <section id="@Name.ToLower()">
        <AppHeading Level="3" Href="@($"#{Name.ToLower()}")" Content="@(I18n.T(Name))"></AppHeading>

        <div>
            <div class="d-flex mb-2">
                <AppTextField @bind-Value="filter" BackgroundColor="#F6F8FD" Icon="mdi-magnify" Clearable Label="@I18n.T("Search")" />
            </div>

            <ApiDatatable Field="@Name" Data="Data" Filter="@filter" />
        </div>
    </section>
}

@code {

    [Parameter]
    [EditorRequired]
    public string Name { get; set; } = null!;

    [Parameter]
    [EditorRequired]
    public List<ParameterInfo>? Data { get; set; }

    private string filter;

}
